package entities;

import java.awt.Color;
import java.awt.Graphics2D;

/**
 * Bar is essentially a spring with a high k value.
 * @author Lance Co Ting Keh
 * @author Paul Dannenberg
 *
 */
public class Bar extends Spring {

    private static final double SPRING_CONSTANT = 20;

    /**
     * @param pointObject -first mass attached to bar
     * @param pointObject2 -second mass attached to bar
     * @param restLength - rest length of the bar
     */
    public Bar(PointObject pointObject, PointObject pointObject2,
            double restLength) {
        super(pointObject, pointObject2,
                pointObject.getDistance(pointObject2), SPRING_CONSTANT);
    }

    @Override
    public void chooseStyle(Graphics2D pen, int xStart,
            int yStart, int xEnd, int yEnd) {
        pen.setColor(Color.DARK_GRAY);
    }
}



